//
//  CinemaTableViewCell.m
//  豆瓣
//
//  Created by dllo on 15/12/11.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "CinemaTableViewCell.h"

@interface CinemaTableViewCell ()

@property (nonatomic, retain) UILabel *cinemaName;
@property (nonatomic, retain) UILabel *address;
@property (nonatomic, retain) UILabel *telephone;
@property (nonatomic, retain) UILabel *trafficRoutes;

@end

@implementation CinemaTableViewCell



- (void)dealloc{
    [_cinemaName release];
    [_address release];
    [_telephone release];
    [_trafficRoutes release];
    [_cinema release];
    [super dealloc];
}

- (void)setCinema:(Cinema *)cinema{
    if (_cinema != cinema) {
        [_cinema release];
        _cinema = [cinema retain];
    }
    self.telephone.text = self.cinema.telephone;
    self.cinemaName.text = self.cinema.cinemaName;
    self.address.text = self.cinema.address;
    self.address.numberOfLines = 0;
    
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
//        NSLog(@"123123123");
    }
    return self;
}

- (void)createSubviews{
    
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg_eventlistcell"]];
    imageView.frame = CGRectMake(10, 15, 355, 120);
    [self.contentView addSubview:imageView];
    [imageView release];
    
    self.cinemaName = [[UILabel alloc] initWithFrame:CGRectMake(5, 3, 350, 50)];
    [imageView addSubview:_cinemaName];
    [_cinemaName release];
    
    self.address = [[UILabel alloc] initWithFrame:CGRectMake(5, 45, 350, 40)];
    self.address.font = [UIFont systemFontOfSize:12];
    [imageView addSubview:_address];
    [_address release];
    
    self.telephone = [[UILabel alloc] initWithFrame:CGRectMake(5, 85, 350, 20)];
    self.telephone.font = [UIFont systemFontOfSize:12];
    [imageView addSubview:_telephone];
    [_telephone release];
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
